package compiler.scanner;

public enum Token {
	// If a Token is one of {Ident, Number, RelOp, PlusMinus, MultDiv, FuncProc},
	// then you should assign the value of the token by invoking setValue() method.
	Identifier,
	Number,
	RelOpr,
	SqrBracketL,
	SqrBracketR,
	ParenL,
	ParenR,
	PlusMinus,
	MultDiv,
	Assign,
	Comma,
	Colon,
	Semicolon,
	Period,
	If,
	Then,
	Else,
	End,
	While,
	Do,
	Return,
	Var,
	Integer,
	Array,
	Of,
	FuncProc,
	Begin,
	Module;
	
	int line;
	int position;		
	String value;


	//public setn
	public String toString() {
		return "[" + this.name() + "]\t" + ((value == null)? "" : value);
	}	

	public String value() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public int line() {
		return line;
	}
	
	public int position() {
		return position;
	}
	
	public void setLocation(int line, int position) {
		this.line = line;
		this.position = position;
	}
}
